/************************************************************************
  * Copyright(c) 2023 Levetop Semiconductor Co.,Led. All rights reserved.
  * @file     rtc.h
  * @author   UartTFT Application Team
  * @version  V0.0.1
  * @date     2023-01-01
  * @brief    
 *************************************************************************/

#ifndef _RTC_H
#define _RTC_H

#include "delay.h"
#include "data.h"
#include "bsp.h"

typedef struct
{
	vu16 w_year;
	vu8 w_month;
	vu8 w_date;
	vu8 hour;
	vu8 min;
	vu8 sec;
	vu8 week;
} _calendar_obj;
extern _calendar_obj calendar;	// the Gregorian calendar

uint8_t LT_RtcInit(void);
void PMU_RTC_IRQHandler(void);

uint8_t Is_Leap_Year(uint16_t year);
uint8_t RTC_Set(uint16_t syear, uint8_t smon, uint8_t sday, uint8_t hour, uint8_t min, uint8_t sec);
uint8_t RTC_Get(void);
uint8_t RTC_Get_Week(uint16_t year, uint8_t month, uint8_t day);

#endif /* _RTC_H */
